package com.woniuxy.dao;

import com.woniuxy.entity.Topic;
import com.woniuxy.entity.dto.TopicUserDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TopicDao {
    int createTopic(Topic topic);

    List<Topic> findTopic(Topic topic);

    List<Topic> findTopicByUserId(int userid);

    List<Topic> findTopicByTrainingId(int trainingid);


    Topic findTopicByUserIdAndTopicId(@Param("userid") int userid, @Param("topicid") int topicid);

    Integer apply(@Param("userid")int userid,@Param("trainingid") int trainingid);

    int createUserTopic(@Param("userid")int userid,@Param("topicid") int topicid,@Param("trainingid") int trainingid);

    int createUserTraining(@Param("userid")int userid,@Param("trainingid") int trainingid);

    /*/*
     * Description : 考完试后更新用户试卷得分及状态
     * ChangeLog : 1. 创建 (2022/3/17 18:41 [10604]);
     ** @param null
     * *  @return null
    */
    int updateTopic(TopicUserDto topicUserDto);

    int deleteTopic(Topic topic);

    /*/*
     * Description : 对试卷进行属性的修改
     * ChangeLog : 1. 创建 (2022/3/17 18:41 [10604]);
     ** @param null
     * *  @return null
    */
    int updateTopics(Topic topic);
    /*/*
     * Description : 通过考试id查询培训
     * ChangeLog : 1. 创建 (2022/3/18 23:46 [10604]);
     ** @param null
     * *  @return null
    */
    List<Integer> findTrainingByTopicId(int topicid);
}





